package com.grifo.test;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

import com.grifo.domain.Usuario;

public class DBGrifoTools {

	/**
	 * @param args
	 */

	public static class SchemExport {
		public static void main(String[] args) {
			AnnotationConfiguration cfg = new AnnotationConfiguration();
			cfg.addAnnotatedClass(Usuario.class);
			cfg.configure();
			SchemaExport se = new SchemaExport(cfg);
			se.setOutputFile("src/com/grifo/database/create-tables.sql");
			se.setFormat(false);
			se.setDelimiter(";");
			se.drop(true, false);
			se.create(true, true);
		}
	}

}
